package com.dataseek.iot.device.controller;

import com.dataseek.iot.device.mqtt.MqttSubSys;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;

/**
 * @Author: xct
 * @Date: 2021/7/30 17:20
 * @Description:
 */
@Controller
public class ConsumerController {
    @Autowired
    private MqttSubSys mqttSub;

    @PostConstruct
    public void consumeMqttClient() throws MqttException {
        System.out.println("=====ConsumerController======订阅consumer====");
        mqttSub.init();           // 订阅 消息
    }
}